home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CBASE102.ARJ / CBINST.BAT < prev    next >
DOS Batch File  |  1991-09-23  |  6KB  |  159 lines

  1. @echo off
  2. rem cbase installation batch file-----------------------------------------------
  3. rem cbinst.bat    1.5 - 91/09/23
  4.  
  5. rem ----------------------------------------------------------------------------
  6. rem NAME
  7. rem      install.bat - cbase library installation batch file for DOS
  8. rem
  9. rem SYNOPSIS
  10. rem      install model [x]
  11. rem
  12. rem DESCRIPTION
  13. rem     install.bat performs the installation of the cbase library for
  14. rem     DOS.  model specifies the memory model as one of the following.
  15. rem
  16. rem          S        small model
  17. rem          M        medium model
  18. rem          C        compact model
  19. rem          L        large model
  20. rem          H        huge model
  21. rem
  22. rem     The library file is named Mcbase.lib, where M would correspond
  23. rem     to the memory model of the library.
  24. rem
  25. rem     If specified, the second parameter causes the reference manual to
  26. rem     be extracted from the source code.  The reference manual is placed
  27. rem     in the file cbase.man.
  28. rem
  29. rem SEE ALSO
  30. rem      makefile
  31. rem
  32. rem NOTES
  33. rem      This batch file is written for use with Microsoft C.  To convert
  34. rem      it for use with another compiler, make the following
  35. rem      modifications:
  36. rem           1. Replace \usr\include with the include directory used by
  37. rem              the new compiler.
  38. rem           2. Replace \usr\lib with the library directory used by the
  39. rem              new compiler.
  40. rem           3. Replace cl with the command to invoke the compiler being
  41. rem              used, replacing the switches also, if necessary.  Below
  42. rem              are listed the Microsoft C switches used and their
  43. rem              meanings.
  44. rem                   -c        compile but don't link
  45. rem                   -Oalt     optimization
  46. rem                             a - relax alias checking
  47. rem                             l - enable loop optimization
  48. rem                             t - favor execution speed
  49. rem                   -Za       ANSI keywords only
  50. rem                   -A        memory model
  51. rem           4. The command to build the library archive from the object
  52. rem              modules may vary more drastically.  Microsoft C uses the
  53. rem              lib command with what is called a response file.  This
  54. rem              response file, cbase.rsp, contains a list of all the
  55. rem              object modules in the library.
  56. rem
  57. rem ----------------------------------------------------------------------------
  58.  
  59. rem verify arguments------------------------------------------------------------
  60. if "%1" == "S" goto arg1
  61. if "%1" == "M" goto arg1
  62. if "%1" == "C" goto arg1
  63. if "%1" == "L" goto arg1
  64. if "%1" == "H" goto arg1
  65. echo usage:  install model [x]
  66. echo Valid values for model are S (small), M (medium), C (compact),
  67. echo   L (large), and H (huge).  Model must be upper case.
  68. echo If x is specified, the reference manual will be extracted.
  69. goto end
  70. :arg1
  71.  
  72. if "%2" == "" goto arg2
  73. if "%2" == "x" goto arg2
  74. echo usage:  install model [x]
  75. echo Invalid second argument.  Valid value is lowercase x.
  76. goto end
  77. :arg2
  78.  
  79. if "%3" == "" goto arg3
  80. echo usage:  install model [x]
  81. echo Too many arguments specified.
  82. goto end
  83. :arg3
  84.  
  85. rem check if underlying libraries installed-------------------------------------
  86. if exist \usr\include\lseq.h goto lseq
  87. echo The lseq library must be installed first.
  88. goto end
  89. :lseq
  90. if exist \usr\include\btree.h goto btree
  91. echo The btree library must be installed first.
  92. goto end
  93. :btree
  94.  
  95. rem extract the reference manual------------------------------------------------
  96. if not "%2" == "x" goto skipman
  97. echo Extracting reference manual into cbase.man.
  98. if not exist cbase.man goto man
  99. echo cbase.man exists.  ^C to exit, any other key to continue.
  100. pause
  101. :man
  102. if not exist tmp goto tmp
  103. echo tmp exists.  ^C to exit, any other key to continue.
  104. pause
  105. :tmp
  106. echo on
  107. type cbase.h | manx -c > cbase.man
  108. copy cbclose.c/a+cbcreate.c+cbdelcur.c+cbexport.c+cbgetkcu.c+cbgetlck.c tmp
  109. type tmp | manx -c >> cbase.man
  110. copy cbgetr.c/a+cbgetrcu.c+cbgetrf.c+cbimport.c+cbinsert.c+cbkcurso.c tmp
  111. type tmp | manx -c >> cbase.man
  112. copy cbkeyali.c/a+cbkeyfir.c+cbkeylas.c+cbkeynex.c+cbkeypre.c+cbkeysrc.c tmp
  113. type tmp | manx -c >> cbase.man
  114. copy cblock.c/a+cbmkndx.c+cbopen.c+cbputr.c+cbrcurso.c+cbrecali.c tmp
  115. type tmp | manx -c >> cbase.man
  116. copy cbreccnt.c/a+cbrecfir.c+cbreclas.c+cbrecnex.c+cbrecpre.c+cbrecsiz.c tmp
  117. type tmp | manx -c >> cbase.man
  118. copy cbrmndx.c/a+cbsetkcu.c+cbsetrcu.c+cbsync.c tmp
  119. type tmp | manx -c >> cbase.man
  120. del tmp
  121. @echo off
  122. :skipman
  123.  
  124. rem compile all cbase source files----------------------------------------------
  125. echo on
  126. cl -c -Oalt -Za -A%1 cbclose.c  cbcreate.c cbdelcur.c cbexport.c cbgetkcu.c cbgetlck.c
  127. cl -c -Oalt -Za -A%1 cbgetr.c   cbgetrcu.c cbgetrf.c  cbimport.c cbinsert.c cbkeyali.c
  128. cl -c -Oalt -Za -A%1 cbkeyfir.c cbkeylas.c cbkeynex.c cbkeypre.c cbkeysrc.c cblock.c
  129. cl -c -Oalt -Za -A%1 cbmkndx.c  cbopen.c   cbputr.c   cbrecali.c cbrecfir.c cbreclas.c
  130. cl -c -Oalt -Za -A%1 cbrecnex.c cbrecpre.c cbrmndx.c  cbsetkcu.c cbsetrcu.c cbsync.c
  131. cl -c -Oalt -Za -A%1 cbcmp.c    cbexp.c    cbimp.c    cbops.c
  132. @echo off
  133.  
  134. rem build the cbase library archive---------------------------------------------
  135. if exist %1cbase.lib del %1cbase.lib
  136. echo on
  137. lib %1cbase @cbase.rsp
  138. @echo off
  139.  
  140. rem install the cbase library---------------------------------------------------
  141. if not exist \usr\include\cbase.h goto h
  142. echo \usr\include\cbase.h exists.  ^C to exit, any other key to continue.
  143. pause
  144. :h
  145. echo on
  146. copy cbase.h \usr\include\cbase.h
  147. @echo off
  148.  
  149. if not exist \usr\lib\%1cbase.lib goto lib
  150. echo \usr\lib\%1cbase.lib exists.  ^C to exit, any other key to continue.
  151. pause
  152. :lib
  153. echo on
  154. copy %1cbase.lib \usr\lib\%1cbase.lib
  155. @echo off
  156.  
  157. rem end of cbase installation batch file----------------------------------------
  158. :end
  159.